package day10test;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = "2071632480";
        String s2 = "12345678";

        for (int i = 0; i <= 3; i++) {
            System.out.println("请输入账号");
            String accountNumber = sc.next();
            if (s1.equals(accountNumber)) {
                for (int j = 0; j <= 3; j++) {
                    System.out.println("请输入密码");
                    String passWord = sc.next();
                    if (s2.equals(passWord)) {
                        System.out.println("密码正确，正在登录");
                        break;
                    } else {
                        if ((3 - j) == 0){
                            System.out.println("下次再试吧");
                        }else{
                            System.out.println("输入错误，还有" + (3 - j) + "次机会");
                        }

                    }
                }
                break;
            } else {
                if ((3 - i) == 0){
                    System.out.println("下次再试吧");
                }else{
                    System.out.println("账号错误，还有" + (3 - i) + "次机会");
                }

            }
        }

    }
}
